﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EricBlog.Models;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace EricBlog.Controllers
{
    [Route("[controller]/[action]")]
    [ApiController]
    [EnableCors("any")]

    public class welcomeController : ControllerBase
    {
        private readonly Join _Join;
        public welcomeController(Join join)
        {
            _Join = join;
        }
        [HttpGet]
        public Array GetSentence()
        {
            var sentence = _Join.sentenceforwelcome.Select(r => r.sentence).ToArray();
            return sentence;
        }
    }
}
